package com.drm.netschool.mapper;

import com.drm.netschool.entity.DrmCourseCount;
import com.drm.netschool.entity.DrmCourseCountExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DrmCourseCountMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_count
     *
     * @mbggenerated Thu Aug 13 00:51:57 CST 2015
     */
    int countByExample(DrmCourseCountExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_count
     *
     * @mbggenerated Thu Aug 13 00:51:57 CST 2015
     */
    int deleteByExample(DrmCourseCountExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_count
     *
     * @mbggenerated Thu Aug 13 00:51:57 CST 2015
     */
    @Delete({
        "delete from drm_course_count",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_count
     *
     * @mbggenerated Thu Aug 13 00:51:57 CST 2015
     */
    @Insert({
        "insert into drm_course_count (id, course_id, ",
        "course_buycnt, course_commentcnt, ",
        "course_browsercnt)",
        "values (#{id,jdbcType=BIGINT}, #{courseId,jdbcType=BIGINT}, ",
        "#{courseBuycnt,jdbcType=INTEGER}, #{courseCommentcnt,jdbcType=INTEGER}, ",
        "#{courseBrowsercnt,jdbcType=INTEGER})"
    })
    int insert(DrmCourseCount record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_count
     *
     * @mbggenerated Thu Aug 13 00:51:57 CST 2015
     */
    int insertSelective(DrmCourseCount record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_count
     *
     * @mbggenerated Thu Aug 13 00:51:57 CST 2015
     */
    List<DrmCourseCount> selectByExample(DrmCourseCountExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_count
     *
     * @mbggenerated Thu Aug 13 00:51:57 CST 2015
     */
    @Select({
        "select",
        "id, course_id, course_buycnt, course_commentcnt, course_browsercnt",
        "from drm_course_count",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    DrmCourseCount selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_count
     *
     * @mbggenerated Thu Aug 13 00:51:57 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmCourseCount record, @Param("example") DrmCourseCountExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_count
     *
     * @mbggenerated Thu Aug 13 00:51:57 CST 2015
     */
    int updateByExample(@Param("record") DrmCourseCount record, @Param("example") DrmCourseCountExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_count
     *
     * @mbggenerated Thu Aug 13 00:51:57 CST 2015
     */
    int updateByPrimaryKeySelective(DrmCourseCount record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_count
     *
     * @mbggenerated Thu Aug 13 00:51:57 CST 2015
     */
    @Update({
        "update drm_course_count",
        "set course_id = #{courseId,jdbcType=BIGINT},",
          "course_buycnt = #{courseBuycnt,jdbcType=INTEGER},",
          "course_commentcnt = #{courseCommentcnt,jdbcType=INTEGER},",
          "course_browsercnt = #{courseBrowsercnt,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(DrmCourseCount record);
}